<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>广告</title>
  <link rel="stylesheet" type="text/css" href="<%=path %>/style/easyui.css">
  <link rel="stylesheet" type="text/css" href="<%=path %>/style/icon.css">
  <link rel="stylesheet" type="text/css" href="<%=path %>/style/neweasyui/themes/gray/panel.css">
  <link rel="stylesheet" type="text/css" href="<%=path %>/style/neweasyui/themes/gray/window.css">
  <script type="text/javascript" src="<%=path %>/script/1.11.1.js"></script>
  <script type="text/javascript" src="<%=path %>/script/jquery.easyui.min.js"></script>
  <script type="text/javascript" src="<%=path %>/script/jquery.easyui.min.js"></script>
  <script type="text/javascript" src="<%=path %>/script/easyui-lang-zh_CN.js"></script>
  <script type="text/javascript" src="<%=path %>/script/dateFormat.js"></script>
  <script type="text/javascript" src="<%=path %>/script/datagrid-bufferview.js"></script>
  <script type="text/javascript" src="<%=path %>/script/common.js"></script>
  <script type="text/javascript" src="<%=path %>/script/ckeditor/ckeditor.js"></script>
  <style type="text/css">
    #fm{
      margin:0;
      padding:10px 30px;
    }
    .ftitle{
      font-size:14px;
      font-weight:bold;
      padding:5px 0;
      margin-bottom:10px;
      border-bottom:1px solid #ccc;
    }
    .fitem{
      margin-bottom:17px;
    }
    .fitem label{
      display:inline-block;
      width:80px;
    }
    .fitem input{
      width:230px;
    }
  </style>
</head>
<body>
<table id="tt" title="class" style="width:auto;height:500px">
</table>
<!-----------------------------------------------------------------按钮------------------------------------------------------------------->
<div id="toolbar" style="padding:5px;height:auto">
  <div>
  	<!--    广告：<input id="s_adId"  name="s_adId" type="text" class="easyui-datebox" style="width:150px" />&nbsp;&nbsp;-->
      广告位：  <input class="easyui-combobox"  id="s_position" 
				name="s_position"
				data-options="
						url:'<%=basePath %>service/combo/ad',
						method:'get',
						valueField:'valueField',
						textField:'textField',
						panelHeight:'auto'
				">&nbsp;&nbsp;
      平台：  <input class="easyui-combobox"  id="s_platform" 
				name="s_platform"
				data-options="
						url:'<%=basePath %>service/combo/class',
						method:'get',
						valueField:'valueField',
						textField:'textField',
						panelHeight:'auto'
				">&nbsp;&nbsp;
    <a href="javascript:void(0)"  class="easyui-linkbutton" iconCls="icon-search" onclick="searchSentence()">查询</a>
  
    <!-- 搜索条件结束 -->

  </div>
</div>
<!-------------------------------------------------------------添加/编辑框 开始----------------------------------------------------------------------->
<!-- 添加/编辑框结束-->

</body>
<script type="text/javascript">
  var class_id,course_id,gate_id;
  $.ajaxSetup({cache:false});
  $(function(){
    $('#tt').datagrid({
      url:'<%=basePath %>service/ad/count',
      method:'get',
      singleSelect:true,toolbar:'#toolbar',remoteSort:false,pageSize:50,nowrap:false,
      fitColumns:true,pagination:true,rownumbers:true,
      columns:[[
        {field:'id',title:'ID',sortable:true,width:20,hidden:true},
        {field:'count',title:'次数',sortable:true,width:50},
        {field:'adId',title:'广告',sortable:true,width:60,hidden:true},
        {field:'adName',title:'广告',sortable:true,width:60},
        {field:'positionId',title:'广告位',sortable:true,width:80,hidden:true},
        {field:'positionName',title:'广告位',sortable:true,width:80},
        {field:'platformGuid',title:'平台',sortable:true,width:80,hidden:true},
        {field:'plateformName',title:'平台',sortable:true,width:80}
      ]],
    
    });
  });
//------------------------------------------------------------------------------------------
  //关闭弹出框
  function closeDialog(){
    $('#addad').dialog('close') ;
  }

  function searchSentence(){
	  var sPlatform = $("#s_platform").textbox("getValue");
	  var sPosition = $("#s_position").textbox("getValue");
		 var url = '<%=basePath %>service/ad/count?adId=&positionId='+sPosition+'&platformGuid='+sPlatform;
		 $("#tt").datagrid({
			 url:'<%=basePath %>service/ad/count?adId=&positionId='+sPosition+'&platformGuid='+sPlatform,
			 method:'get',
			 onLoadSuccess:function(data){
				 if(data.total == null){
					 $.messager.alert("提示","没有查询到任何符合条件的数据")
				 }
			 }
		 });
  }

  

</script>
</html>
